@tool
class_name ControllerCommand_RemoveControllerCommand
extends ControllerCommand

## 移除控制指令

enum RemoveType
{
	Tag,
	Type,
	Id,
}
#region 属性
@export var remove_type:RemoveType
@export var tag:String
@export var controller_command_type:GameEnum.ControllerCommandType
@export var command_id:int
#endregion
#region 字段
#endregion
#region 信号
#endregion

#region 基类方法
#endregion
#region 公共方法
func activate(controller:ControllerComponent,command_dict_by_tag:Dictionary) -> bool:
	if not super(controller,command_dict_by_tag):
		return false
	match remove_type:
		RemoveType.Tag:
			if not tag.is_empty():
				controller.controller_command_manager.remove_controller_command_by_tag(tag)
		RemoveType.Type:
			controller.controller_command_manager.remove_controller_command_by_controller_command_type(controller_command_type)
		RemoveType.Id:
			if command_id >= 0:
				controller.controller_command_manager.remove_controller_command_by_command_id(command_id)
		_:
			pass
	return true
func deactivate(controller:ControllerComponent,command_dict_by_tag:Dictionary):
	super(controller,command_dict_by_tag)
#endregion
#region 私有方法
#endregion
#region 生命周期函数
func _init() -> void:
	if Engine.is_editor_hint():
		resource_local_to_scene = true
#endregion
